/*
 * shminit.cpp
 *
 *  Created on: Jul 14, 2013
 *      Author: m
 */

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "NewSharedMemory.h"

using namespace ipc;

const int shmSize = 2;
const int dataPosition = 0;
const int writeCounterPosition = 1;

int main ( void )
{
    char mostrar[10240];

    SharedMemory<int> shm = SharedMemory<int>::create( "/tmp/myshm", 'a', shmSize );

    shm.initialize( 0 );

    sprintf( mostrar,
            "SHMINIT: "
            "Shared Memory Array initialized.\n" );
    write( fileno(stdout), mostrar, strlen(mostrar) );

    return 0;
}
